#pragma once

#include <EASTL/unique_ptr.h>
#include <utl/image.h>

struct SDL_Surface;
struct SDL_Window;
struct SDL_Renderer;

namespace primary
{
	struct SDL_SURFACE_DELETER
	{
		void operator()(SDL_Surface* p) const noexcept;
	};

	struct SDL_WINDOW_DELETER
	{
		void operator()(SDL_Window* p) const noexcept;
	};

	struct SDL_RENDERER_DELETER
	{
		void operator()(SDL_Renderer* p)const noexcept;
	};

	using sdlSurface = eastl::unique_ptr<SDL_Surface, SDL_SURFACE_DELETER>;
	using sdlWindow = eastl::unique_ptr<SDL_Window, SDL_WINDOW_DELETER>;
	using sdlRenderer = eastl::unique_ptr<SDL_Renderer, SDL_RENDERER_DELETER>;

	//this is single class but dont have state chake
	class SDL
	{
	public:
		SDL();
		~SDL();

		sdlWindow CreateSDLWindow(int w = 800, int h = 800, const char* title = "Default");
		sdlSurface CreateSDLSurface(utl::image& img);
		sdlRenderer CreateSDLRenderer(SDL_Window* win);
	};
}